import request from '@/config/axios'

// 扫码权限用户 VO
export interface PickupOpUsersVO {
  id: number // 唯一标识
  userId: number // 用户 ID
  userNickname: string,
  mobile: string,
  status: number // 0正常 1 不正常
}

// 扫码权限用户 API
export const PickupOpUsersApi = {
  // 查询扫码权限用户分页
  getPickupOpUsersPage: async (params: any) => {
    return await request.get({ url: `/pickup/op-users/page`, params })
  },

  // 查询扫码权限用户详情
  getPickupOpUsersById: async (id: number) => {
    return await request.get({ url: `/pickup/op-users/getById?id=` + id })
  },

  // 新增扫码权限用户
  createPickupOpUsers: async (data: PickupOpUsersVO) => {
    return await request.post({ url: `/pickup/op-users/create`, data })
  },

  // 修改扫码权限用户
  updatePickupOpUsers: async (data: PickupOpUsersVO) => {
    return await request.post({ url: `/pickup/op-users/update`, data })
  },

  // 修改扫码权限用户状态
  updatePickupOpUsersStatus: async (id: number, status: number) => {
    const data = {
      id,
      status
    }
    return await request.post({ url: `/pickup/op-users/updateStatus`, data: data })
  },

  // 删除扫码权限用户
  deletePickupOpUsersById: async (id: number) => {
    return await request.get({ url: `/pickup/op-users/delete?id=` + id })
  },

  // 导出扫码权限用户 Excel
  exportPickupOpUsers: async (params) => {
    return await request.download({ url: `/pickup/op-users/export-excel`, params })
  }
}